package demo.java.parallelprogram.threadpool;

import java.util.Date;

public class MyThreadLocal  implements Runnable {

	public static final ThreadLocal<Date> localvar = new ThreadLocal<>();
	
	private long time;
	public MyThreadLocal(long time){
		this.time=time;
	}
	
	@Override
	public void run() {
		Date d= new Date(time);
		for(int i=0;i<5000;i++){
			localvar.set(d);
			if(localvar.get().getTime()!=time){
				System.out.println("id="+time+"localvar="+localvar.get().getTime());
			}
		}
	}
	
}
